Delay-cost (DC) is a measure used by conventional schedulers for scheduling of pending computing jobs in a computer system. Here each computing job in the system is given a time-varying measure of the (i) cost of delaying its processing or of the (ii) value of assigning a processor. The scheduler chooses a computing job to be run with the highest DC value. This approach is used successfully in single-threaded, single-cored processors, where a computing job is assigned one processor at a time. However, the tendency in modern processor design is to incorporate multiple cores on one chip, and have each core incorporate multiple hardware threads. A software thread may be dispatched for execution on a hardware thread. A computing job may include several software threads which may each be dispatched on hardware threads of a single core or distributed amongst hardware threads of multiple cores. It can be a complex task to efficiently schedule the execution of computing jobs that have several software threads on multiple cores.
Today, it may be desirable for a computer system to run more than one guest operating system. Each guest operating system can be considered a computing job, having multiple threads and/or processes. Modern systems can make use of software known as a hypervisor to manage one or more such guest operating systems and the resources that they require. A hypervisor typically includes a scheduler to allocate some number of processors to each guest operating system. The scheduler determines which operating system guest to run, how many cores or partial cores to assign to each guest, and which cores to assign.
A hypervisor scheduler according to the conventional art assigns a “fair share” quantity to each operating system guest. Guests may be assigned uninterruptible time slices for executing their jobs. Guests which have received less than their fair share of time may be given priority over those that have received more. Although such conventional schedulers can provide good performance in a variety of situations, they do not explicitly address such problems as scheduling multiple simultaneously executing threads ting system scheduling context, or multiple requested processors in a hypervisor context. Further, they do not explicitly incorporate tradeoffs associated with core or hardware thread assignments, or include energy usage tradeoffs.
Thus, there is a need for an improved method and a system for scheduling the allocation of threads which incorporates delay cost.